﻿<%@ Page Title="" Language="C#" MasterPageFile="~/sysAdministrator/sysAdministrator.Master" AutoEventWireup="true" 
    CodeBehind="DormitoryAdd.aspx.cs" Inherits="WebApplication1.sysAdministrator.DormitoryAdd" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="position:relative;top:5px;left:10px">
     <asp:Label ID="Label1" runat="server" Text="宿舍楼名："  style=""></asp:Label>
    <asp:TextBox ID="selectName" runat="server" Width="88px"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" Text="查询" OnClick="s_Click" />
    <asp:Button ID="Button2" runat="server" Text="添加" OnClick="add_Click"/>
     <asp:Button ID="Button3" runat="server" Text="查询全部" OnClick="selectAll_Click"  />
     </div>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
        OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing" 
        OnRowUpdating="GridView1_RowUpdating" PageSize="3" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowDataBound="GridView1_RowDataBound" CellPadding="4" CellSpacing="10" Width="100%" ForeColor="#333333" GridLines="None">
             <AlternatingRowStyle BackColor="White"/>
        <Columns>
             <asp:TemplateField HeaderText="id" Visible="false">                       
                    <ItemTemplate>
                        <asp:Label ID="id" runat="server" Text='<%#Bind("Id") %>' />
                    </ItemTemplate>                                 
                </asp:TemplateField>
                <%--宿舍楼--%>
                 <asp:TemplateField HeaderText="宿舍楼">                       
                    <ItemTemplate>
                        <asp:Label ID="hostel" runat="server" Text='<%#Bind("Name") %>' />
                    </ItemTemplate>   
                     <EditItemTemplate>
                         <asp:TextBox ID="dhostel" runat="server" Text='<%#Bind("Name") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                  <%-- 管理员--%>
                <asp:TemplateField HeaderText="管理员">
                    <ItemTemplate>
                        <asp:Label ID="admin" runat="server" Text='<%#Bind("Manager") %>' />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:DropDownList ID="drpAdmin" runat="server">
                        </asp:DropDownList>
                    </EditItemTemplate>
                </asp:TemplateField>

             <%--操作--%>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <asp:Button ID="btndelete" runat="server" Text="删除" CommandName="delete" />
                        <asp:Button ID="btnedit" runat="server" Text="编辑" CommandName="edit"/>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:Button ID="btnupdate" runat="server" Text="更新" CommandName="update" />
                        <asp:Button ID="btncancel" runat="server" Text="取消" CommandName="cancel" />
                    </EditItemTemplate>
                </asp:TemplateField>
        </Columns>
             <EditRowStyle BackColor="#2461BF" />
             <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
             <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
             <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
             <RowStyle BackColor="#EFF3FB" />
             <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
             <SortedAscendingCellStyle BackColor="#F5F7FB" />
             <SortedAscendingHeaderStyle BackColor="#6D95E1" />
             <SortedDescendingCellStyle BackColor="#E9EBEF" />
             <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>

    <asp:Panel ID="Panel1" runat="server" width="400px" Height="300px">
         <div style="border-radius: 15px;
            background-color: #fff;
            width: 400px;
            position: absolute;
            top:130px;
            height: 170px;
            margin-left: 480px;
            box-shadow: 0px 1px 3px 0px rgba(119,119,119,0.99);">
     <table id="table" class="auto-style4" style=" margin: 0 auto;font-size:large;position: relative;top:15px">
        <tr>
            <td colspan="2"  align="center" style="font-size:x-large"">添加宿舍楼信息</td>
        </tr>
        <tr>
            <td class="auto-style5" align="right" Width="100px">宿舍楼名：</td>
            <td>
                <asp:TextBox ID="addName" runat="server" Height="25px" Width="250px"></asp:TextBox>
            </td>
        </tr>
         <tr>
            <td class="auto-style5" align="right" Width="100px">管理员：</td>
            <td class="auto-style5">
                <asp:DropDownList ID="addAdmin" runat="server">
                 </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="auto-style5" colspan="2" align="center">
                <asp:Button ID="Button4" runat="server" Text="添加" Height="30px" Width="56px" OnClick="okAdd_Click" style="margin-top:20px"/>
                <asp:Button ID="Button5" runat="server" Text="取消" Height="30px" Width="56px" OnClick="escAdd_Click" style="margin-top:20px"/>
            </td>
        </tr>
    </table>
               </div>
        </asp:Panel>
</asp:Content>
